/*
 * @Author: fengshan0525 2735332396@qq.com
 * @Date: 2023-03-17 20:42:43
 * @LastEditors: fengshan525 2735332396@qq.com
 * @LastEditTime: 2025-09-21 13:49:19
 * @FilePath: \nest-template\libs\db\src\db.module.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { Module, Global } from '@nestjs/common';
import { DbService } from './db.service';
import { TypegooseModule } from 'nest-typegoose';
import { AdminUsers } from './models/user.model';
import { AmdinRole } from './models/role.model';
import { AdminMenu } from './models/menu.model';
import { AdminRoleMenu } from './models/role_menu.model';
import { getConfig } from 'utils';
import { Category } from './models/category.model';
import { ListDetail } from './models/list-detail.model';
import { ImageTypes } from './models/images_types.model';
import { Cube } from './models/cube.model';
import { Templates } from './models/templates.model';
import { Image } from './models/images.model';
import { Statistics } from './models/statistics.model';
import { AttemptCustomer } from './models/attempt.model';
import { Swiper } from './models/swiper.model';
import { HandpicDevice } from './models/handpic-device.model';
import { Module as ModuleModel } from './models/module.model';
import { WebMenu } from './models/webmenu.model';
import { EmailConfig } from './models/email-config.model';

export * from './models/user.model';
export * from './models/role.model';
export * from './models/menu.model';
export * from './models/role_menu.model';
export * from './models/category.model';
export * from './models/list-detail.model';
export * from './models/images_types.model';
export * from './models/cube.model';
export * from './models/templates.model';
export * from './models/images.model';
export * from './models/statistics.model';
export * from './models/attempt.model';
export * from './models/swiper.model';
export * from './models/handpic-device.model';
export * from './models/module.model';
export * from './models/webmenu.model';
const models = TypegooseModule.forFeature([
  AdminUsers,
  AmdinRole,
  AdminMenu,
  AdminRoleMenu,
  Category,
  ListDetail,
  ImageTypes,
  Cube,
  Templates,
  Image,
  Statistics,
  AttemptCustomer,
  Swiper,
  HandpicDevice,
  ModuleModel,
  WebMenu,
  EmailConfig,
]);

@Global()
@Module({
  imports: [TypegooseModule.forRoot(getConfig().DATA_BASE), models],
  providers: [DbService],
  exports: [DbService, models],
})
export class DbModule {}
